

class Solution:
    def replaceSpace(self, s: str) -> str:
        new=[]
        i=0
        for i in range(len(s)):
            if s[i]!=' ':
                new.append(s[i])
            if s[i]==' ':
                new.append('%20')

        return ''.join(new)

if __name__ == '__main__':
    s = "We are happy."
    so=Solution()
    print(so.replaceSpace(s))